const systemInfo = uni.getSystemInfoSync()
//获取状态栏高度【()就是空参数嘛】
const getStatusBarHeight = () => systemInfo.statusBarHeight || 20 //没有高度就让状态栏高度为20
//获取标题栏
const getTitleBarHeight = () => {
	//条件编译
	//	#ifdef MP-WEIXIN 
	let menuBtnInfo = uni.getMenuButtonBoundingClientRect(); //小程序的胶囊按钮
	let height = 2 * (menuBtnInfo.top - getStatusBarHeight()) + menuBtnInfo.height;
	return height;
	//	#endif

	//不走微信小程序的话
	//	#ifndef MP-WEIXIN
	return 40;
	//	#endif
}
const system = {
	state: {
		statusBarHeight: getStatusBarHeight(),
		titleBarHeight: getTitleBarHeight(),
		foldState: false
	},
	mutations: { //类似计算属性【突变】
		setFoldState(state, value) {
			state.foldState = value;
		},
	},
	getters: {

	},
	actions: {

	},
}
export default system
